
*** Setup do-file 
cls
clear all
eststo clear
_estimates drop _all
matrix drop _all
cap drop program _all
cap log close 
set seed 08092022
set maxvar 50000
set more off

global graph "ylabel(, nogrid) scheme(s2mono) plotregion(fcolor(white) lcolor(white) margin(small)) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))"


*******************************************************************************

** Set Directories 


** Set global directory
global USEDIR ""


* Set directories 
* Raw data
global ORIGINAL "$USEDIR/RawData" 

* Main data
global OUTDATA "$USEDIR/Data" 

* Tables
global OUTTEX "$USEDIR/Tables" 

* Figures
global OUTFIG "$USEDIR/Figures" 

* Cleaning Codes 
global CLEANING "$USEDIR/Cleaning Codes"

* Main Codes
global MAIN "$USEDIR/Main Paper codes"

* Appendix Codes
global APPENDIX "$USEDIR/Appendix Codes"

* Output for paper
global OUTDIR "$USEDIR/Output" 

* set working directory
cd "$OUTDATA"


*** Install Packages for the paper 

** Uncomment and run this if required packages not installed

/*
global installvar "ssc install"

local var1 "psmatch2 estout reghdfe did_imputation coefplot ftools rwolf twowayfeweights"

foreach m of local var1 { 

$installvar `m', replace

}

*/
*********************  RUN CLEANING CODES ******************************************


** Clean Raw Dowry Data
run  	"$CLEANING/01_REDS_Raw_Clean.do"

** Clean Raw NFHS Data
run  	"$CLEANING/02_NFHS3_Cleaning.do"

** Clean Raw IHDS 2005 Data
run  	"$CLEANING/03_IHDS_data_clean.do"

** Clean Dowry data for Analysis
run  	"$CLEANING/04_REDS_Data_Clean_For_Analysis.do"

** Clean Dowry data with endogenous controls 
run 	"$CLEANING/05_REDS_with_Wealth_Clean.do"

** Clean Dowry data for marriage market analysis 
run 	"$CLEANING/06_REDS_marriage_effects_clean.do"


*********************  RUN Main Paper CODES ******************************************

** Figure 1
run  	"$MAIN/Figure1.do"

** Table 1 and Table 2
run  	"$MAIN/Table1_and_Table2_Dec_Viol.do"

** Standard ErrorsAP
run  	"$MAIN/Standard_Errors_Table_A14_Table1_Table2.do"


*********************  Appendix CODES ******************************************

** Figure A6: Prediction 6: Women’s Human Capital By Cohort
run  	"$APPENDIX/Figure_A6_Human_Capital.do"


** Table A1: Dowries
run  	"$APPENDIX/Table_A1_Dowries.do"

** Table A2: Prediction 3: Differential Effects by Social Stigma
run  	"$APPENDIX/Table_A2_SocialStigma.do"

** Table A3: Prediction 4: Differential Effects by Gains from Marriage
run  	"$APPENDIX/Table_A3_GainsMarriage.do"

** Table A4: Prediction A5: Separations
run  	"$APPENDIX/ATable_A4_Separation.do"

** Table A5 and A6: Women's Human Capital: Education and Height
run  	"$APPENDIX/Table_A5_A6_Education_Height.do"
